﻿using System;
using System.Collections.Generic;
using System.Net;
using UnityEngine;

namespace UniRx
{
	// Token: 0x020003DF RID: 991
	public class WWWErrorException : Exception
	{
		// Token: 0x0600145A RID: 5210 RVA: 0x0005B774 File Offset: 0x00059B74
		public WWWErrorException(WWW www, string text)
		{
			this.WWW = www;
			this.RawErrorMessage = www.error;
			this.ResponseHeaders = www.responseHeaders;
			this.HasResponse = false;
			this.Text = text;
			string[] array = this.RawErrorMessage.Split(new char[]
			{
				' ',
				':'
			});
			int statusCode;
			if (array.Length != 0 && int.TryParse(array[0], out statusCode))
			{
				this.HasResponse = true;
				this.StatusCode = (HttpStatusCode)statusCode;
			}
		}

		// Token: 0x1700017E RID: 382
		// (get) Token: 0x0600145B RID: 5211 RVA: 0x0005B7F5 File Offset: 0x00059BF5
		// (set) Token: 0x0600145C RID: 5212 RVA: 0x0005B7FD File Offset: 0x00059BFD
		public string RawErrorMessage { get; private set; }

		// Token: 0x1700017F RID: 383
		// (get) Token: 0x0600145D RID: 5213 RVA: 0x0005B806 File Offset: 0x00059C06
		// (set) Token: 0x0600145E RID: 5214 RVA: 0x0005B80E File Offset: 0x00059C0E
		public bool HasResponse { get; private set; }

		// Token: 0x17000180 RID: 384
		// (get) Token: 0x0600145F RID: 5215 RVA: 0x0005B817 File Offset: 0x00059C17
		// (set) Token: 0x06001460 RID: 5216 RVA: 0x0005B81F File Offset: 0x00059C1F
		public string Text { get; private set; }

		// Token: 0x17000181 RID: 385
		// (get) Token: 0x06001461 RID: 5217 RVA: 0x0005B828 File Offset: 0x00059C28
		// (set) Token: 0x06001462 RID: 5218 RVA: 0x0005B830 File Offset: 0x00059C30
		public HttpStatusCode StatusCode { get; private set; }

		// Token: 0x17000182 RID: 386
		// (get) Token: 0x06001463 RID: 5219 RVA: 0x0005B839 File Offset: 0x00059C39
		// (set) Token: 0x06001464 RID: 5220 RVA: 0x0005B841 File Offset: 0x00059C41
		public Dictionary<string, string> ResponseHeaders { get; private set; }

		// Token: 0x17000183 RID: 387
		// (get) Token: 0x06001465 RID: 5221 RVA: 0x0005B84A File Offset: 0x00059C4A
		// (set) Token: 0x06001466 RID: 5222 RVA: 0x0005B852 File Offset: 0x00059C52
		public WWW WWW { get; private set; }

		// Token: 0x06001467 RID: 5223 RVA: 0x0005B85C File Offset: 0x00059C5C
		public override string ToString()
		{
			string text = this.Text;
			if (string.IsNullOrEmpty(text))
			{
				return this.RawErrorMessage;
			}
			return this.RawErrorMessage + " " + text;
		}
	}
}
